import request from '@/utils/request'
import { getToken } from '@/utils/auth'

/**
 * 查询配置参数
 * @param  {type:"",parentId:""} query type :参数类型 parentId：参数父id
 * @return {[type]}
 */
export function getParams(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/param/getParam',
    method: 'get',
    params: query
  })
}

/**
 * 查询大项配置数据
 */
export function getParentProjectParams() {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/param/getParam',
    method: 'get',
    params: { type: 105, parentId: '' }
  })
}

/**
 * 查询子项配置数据
 */
export function getChildenParams(parentId) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/param/getParam',
    method: 'get',
    params: { type: 105, parentId: parentId || '' }
  })
}

/**
 * 查询完工配置数据列表
 */
export function getCompletionCol(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/ssoParam/getCompletionCol',
    method: 'get',
    params: query
  })
}
